Skip to content

fix: mask values wrapped in quotes (v2.6.6)#39

Merged
click0 merged 1 commit into
mainfrom
claude/refactor-data-masking-lIcWN
Jul 4, 2026
Merged

fix: mask values wrapped in quotes (v2.6.6)#39
click0 merged 1 commit into
mainfrom
claude/refactor-data-masking-lIcWN

Conversation

@click0

@click0 click0 commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Quoted values were not masked

Names, rank+PIB and IPNs wrapped in quotes («Петренко Іван Сергійович», сержант "Коваленко Марія Іванівна") were silently skipped: words stuck to the quote characters («Петренко, сержант»), and recognition only stripped ,.!?;: — never quotes.

Fix

  • Strip quotes during recognition: looks_like_name, is_pib_anchor, is_likely_surname_by_case, and PIB/rank token extraction in parse_hybrid_line.
  • normalize_string maps all quote styles («» „“” "" '' ‟) to spaces so ranks inside quotes are found.
  • Quotes stay in place in the output; the recognized value (without quotes) is replaced inside them. Roundtrip verified.

Note: a bare rank without a following PIB is still not masked — that's pre-existing behavior (avoids false positives on the word «сержант» in prose) and is independent of quotes.

Test plan

  • 451 tests pass (+17 in tests/test_quoted.py: masking, quote preservation, roundtrip, no-leak, parity with unquoted)

https://claude.ai/code/session_01XT6iUWaQgahXDB9TWX9Bq7


Generated by Claude Code

Names, rank+PIB and IPNs inside «...», "...", „...“ were skipped because
words stuck to quote chars ('«Петренко', 'сержант»') and only ,.!?;: was
stripped. Now quotes are stripped during recognition and normalized to
spaces in normalize_string. Quotes stay in place; roundtrip preserved.
+17 tests (tests/test_quoted.py).

https://claude.ai/code/session_01XT6iUWaQgahXDB9TWX9Bq7
@click0 click0 merged commit 69ecf65 into main Jul 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants